package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.RegionDirectoryModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by admin on 2017/10/26.
 */
public interface RegionDirectoryRepository extends JpaRepository<RegionDirectoryModel,Integer>,JpaSpecificationExecutor<RegionDirectoryModel> {


    @Query(value = " SELECT * from region_directory ",nativeQuery = true)
    List<RegionDirectoryModel> getRegionAll();

    @Query(value = " SELECT * from region_directory a WHERE a.id=1 ",nativeQuery = true)
    RegionDirectoryModel getRegionCountry();

    @Query(value = " select a from RegionDirectoryModel a where a.pid = ?1 ")
    List<RegionDirectoryModel> getRegionCity(Integer pid);



}
